package com.example.cato_cassrndra_.entity;

import lombok.AccessLevel;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.data.cassandra.core.mapping.PrimaryKey;
import org.springframework.data.cassandra.core.mapping.Table;

/*
   将Spring Data 持久化到Cassandra数据库中 ，不在使用jpa持久化的@Entity，而是使用@Table表示持久化到ingredients表中


 */
@Data
@RequiredArgsConstructor
@NoArgsConstructor(access = AccessLevel.PRIVATE,force = true)
@Table("ingredients")
public class Ingredient {
    @PrimaryKey
    private final String id;

    private final String name;

    private final Type type;

    public static enum Type{
        WRAP,PROTEIN,VEGGIES,CHEESE,SAUCE
    }
}
